﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XL.Framework.Domain.Core;
using XL.Framework.Domain.Core.Repository;

namespace Guitar.Comet.Message
{
    /// <summary>
    /// 基于内存的消息存储
    /// </summary>
    public class MemoryMessageRepository<TEntity> : ICommandRepository<TEntity>, IQueryRepository<TEntity> where TEntity : AggregateRoot
    {
        private static readonly BlockingCollection<TEntity> _collection = new BlockingCollection<TEntity>();

        public void Add(TEntity entity)
        {
            _collection.Add(entity);
        }

        public void Remove(TEntity entity)
        {
            throw new NotImplementedException();
        }

        public void Update(TEntity entity)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<TEntity> Find(System.Linq.Expressions.Expression<Func<TEntity, bool>> criteria)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<TEntity> FindAll()
        {
            throw new NotImplementedException();
        }

        public IEnumerable<TEntity> FindInPager<TProperty>(System.Linq.Expressions.Expression<Func<TEntity, bool>> criteria, System.Linq.Expressions.Expression<Func<TEntity, TProperty>> orderBy, int pageIndex, int pageSize, out int totalRecords)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<TEntity> FindInPager<TProperty>(System.Linq.Expressions.Expression<Func<TEntity, TProperty>> orderBy, int pageIndex, int pageSize, out int totalRecords)
        {
            throw new NotImplementedException();
        }

        public TEntity GetSingle(System.Linq.Expressions.Expression<Func<TEntity, bool>> criteria)
        {
            throw new NotImplementedException();
        }
    }
}
